
Menu('show','name','count','sex','school','email','job');


readdate5('notype',"seq",'time1','time2','uname');
function Menu(type,name,count,sex,school,email,job) {
	$.ajax({
		url: "updaterole",
		type: "post",
		dataType: "JSON",
		data: {
            one:type,
            two:name,
			three:count,
			fout:sex,
			five:school,
			six:email,
			seven:job,
		},
		success: function(data) {
			show(data);
			console.log(data);

		},
		error: function(err) {
			console.log(err)
		},
	});
}

function Score() {
	$.ajax({
		url: "Score",
		type: "post",
		dataType: "JSON",
		data: {
     
		},
		success: function(data) {
			show(data);
			console.log(data);
		},
		error: function(err) {
			console.log(err)
		},
	});
}
function show(data){
	 for(i=0;i<data.length;i++){
      document.getElementById("myname").innerHTML=data[i].uSER_NAME;
      document.getElementById("mysex").innerHTML=data[i].sEX;
      document.getElementById("myschool").innerHTML=data[i].sCHOOL;
      document.getElementById("myjob").innerHTML=data[i].jOB;
      document.getElementById("mytel").innerHTML=data[i].tEL;
      document.getElementById("myemail").innerHTML=data[i].eMAIL;
    }
}

function uptext(){
	document.getElementById("uptbody").style.display="block";
}

function uptext1(){
	var name=document.getElementById("upmyname").value;
	var sex=document.getElementById("upmysex").value;
	var school=document.getElementById("upmyschool").value;
	var job=document.getElementById("upmyjob").value;
	var tel=document.getElementById("upmytel").value;
	var email=document.getElementById("upmyemail").value;

	Menu('uptext',name,sex,school,job,tel,email);
}


function show1(data){
	document.getElementById("downtbody").innerHTML='';
	for(i=0;i<data.length;i++){
		CreateScore(data[i].user_NAME,data[i].role_ID,data[i].role_Date,data[i].Score)
	}
}

function CreateScore(name,role,data,Score){
	var tobldy =document.getElementById("downtbody");
	var tr =document.createElement("tr");


	var td=document.createElement("td");
	td.innerHTML=name;

	var td1=document.createElement("td");
    td1.innerHTML=role

	var td2=document.createElement("td");
	td.innerHTML=data;

	var td3=document.createElement("td");
	td.innerHTML=Score;
}

//文档上传

function createtable(seq,name,arcale_type,type,img,score,date,stati){
	var tbody =document.getElementById("tbody");
	var tr = document.createElement("tr");
	var td =document.createElement("td");
	td.id ="seq"+seq;
	td.innerHTML =seq;
	var td1 =document.createElement("td");
	td1.innerHTML=name;
	var td2 =document.createElement("td");
	td2.innerHTML=arcale_type;
	var td3 =document.createElement("td");
	td3.innerHTML=type;
	var td4 =document.createElement("td");
	td4.innerHTML=img;

	var td5 =document.createElement("td");
	td5.innerHTML=score;
	var td6 =document.createElement("td");
	td6.innerHTML=date;

	var td7 =document.createElement("td");
	td7.innerHTML=stati;

	var td8 =document.createElement("td");

	var check=document.createElement('input');
	check.type='button';
	check.value="通过";
	check.onclick =function(){
		var seq=document.getElementById( td.id).innerHTML;
		readdate('upstate',seq,'time1','time2','uname');
	}


	tr.appendChild(td);
	tr.appendChild(td1);
	tr.appendChild(td2);
	tr.appendChild(td3);
	tr.appendChild(td4);
	tr.appendChild(td5);
	tr.appendChild(td6);
	tr.appendChild(td7);
	tr.appendChild(td8);
	td8.appendChild(check);
	tbody.appendChild(tr);
}
function select(){
	var sdate=document.getElementById("starttime").value;
	var edate=document.getElementById("endtime").value;
	var tname =document.getElementById("tname").value;

	alert(sdate);
	alert(edate);
	alert(tname);
	readdate('select',sdate,edate,tname,'uname');
}
//ajks

function readdate5(type,seq,time1,time2,uname) {
	$.ajax({
		url: "Arcale",
		type: "post",
		dataType: "JSON",
		data: {
			one:type,
			two:seq,
			three:time1,
			four:time2,
			five:uname,
		},
		success: function(data) {
			console.log(data);
			alert('进入');
			show5(data);
		},
		error: function(err) {
			console.log(err)
		},
	});
}

function show5(data){
	document.getElementById("tbody").innerHTML='';
	for (i = 0; i < data.length; i++) {
		createtable(data[i].arcale_ID,data[i].user_NAME,data[i].arclae_NAME,data[i].arcale_TYPE,data[i].pic,data[i].arcale_SCORE,data[i].time1,data[i].state_NAME,)

	}
}
